import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:note/common/common.dart';
import 'package:note/widgets/BasePage.dart';

import '../../widgets/buttons.dart';
import 'logic.dart';

class UnlockPage extends StatelessWidget {
  UnlockPage({Key? key}) : super(key: key);

  final logic = Get.put(UnlockLogic());
  final state = Get.find<UnlockLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('设备锁'),
        backgroundColor: Styles.backgroundColor,
        foregroundColor: Styles.mainThemeColor,
      ),
      body: BasePage(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Text(
                '您已上锁！请点击解锁以继续',
                style: Styles.textThemeMedium(20),
              ),
              const SizedBox(
                height: 20,
              ),
              DefaultTextButton(text: '解锁', function: logic.onUnlock),
            ],
          ),
        ),
      ),
    );
  }
}
